using System;
using System.Threading;

public class Target 
{
	public delegate void LaunchProc(string s);

        static public void Launch(string s)
	{
		Console.WriteLine("{0} Start", s );
		Thread.Sleep(15000);
		Console.WriteLine("{0} End", s );
	}

       static public void Main()
	{

        string [] words =
                {"1","2","3","4","5",
                "6","7","8","9","10"};

        LaunchProc pfn = new LaunchProc(Launch);

	   WaitHandle[] wh = new WaitHandle[words.Length];

        for (int t=0; t< words.Length; t++)
		{
			IAsyncResult ar;

			ar = pfn.BeginInvoke(words[t], null, null);
			wh[t] = ar.AsyncWaitHandle;
		}
	

		Console.Write("Kicked off");
		WaitHandle.WaitAll( wh );
		Console.Write("All done");

	   Console.ReadLine();
	
	}
}
